package com.example.mybatisplus.video.service;

import com.example.mybatisplus.video.domain.Question;
import com.example.mybatisplus.video.mapper.QuestionMapper;
import com.example.mybatisplus.video.util.IDUtil;
import com.example.mybatisplus.video.util.ResultObjUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author zhouxl
 * @DATE 2020/9/27
 * @descriptoin
 */
@Component
public class QuestionService {

    @Autowired
    private QuestionMapper questionMapper;

    public Map<String, Object> addQuestion(Question question) {
        Map<String, Object> success = ResultObjUtil.success();
        // todo 参数校验
        question.setQid(IDUtil.uuid());
        int count = questionMapper.addQuestion(question);

        return success;
    }
}
